import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;

public class UDP_receive {
    public static void main(String[] args) throws IOException {
        DatagramSocket datagramSocket = new DatagramSocket(15000);
        byte[] bys = new byte[1024];
        DatagramPacket datagramPacket = new DatagramPacket(bys, bys.length);
        datagramSocket.receive(datagramPacket);
        byte[] data = datagramPacket.getData();
        int len = datagramPacket.getLength();
        System.out.println("The data is : " + new String(data,0,len));
        datagramSocket.close();

    }
}
